From a3f127b0d0038ab30e3feadf048bbeaeee84fd4a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 24 May 2019 01:56:35 +0000 Subject: [PATCH] surface: Give backends a chance to disconnect Call the destroy vfunc before clearing frame clock and gl context, so backends have a chance to clean up. --- gdk/gdksurface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index 16c3ed5e60..28f8f584e9 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -919,6 +919,8 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface, display = gdk_surface_get_display (surface); + GDK_SURFACE_GET_CLASS (surface)->destroy (surface, foreign_destroy); + if (surface->gl_paint_context) { /* Make sure to destroy if current */ @@ -936,8 +938,6 @@ _gdk_surface_destroy_hierarchy (GdkSurface *surface, _gdk_surface_clear_update_area (surface); - GDK_SURFACE_GET_CLASS (surface)->destroy (surface, foreign_destroy); - surface->state |= GDK_SURFACE_STATE_WITHDRAWN; surface->destroyed = TRUE; -- 2.30.2